Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy electricityMap static assets to GCS #2869

Merged
merged 9 commits into from
Jan 4, 2021
Merged

Conversation

corradio
Copy link
Member

@corradio corradio commented Dec 26, 2020

Internal PR to simplify deployment on our side:

  • upload assets to GCS
  • use a consistent working directory such that Dockerfile and BUILD.yaml produce the same folder structure

Blocked by electricitymaps/brick#74

outputs:
- public/dist/zonegeometries.json
- src/world.json
- public/dist
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brick now also builds the frontend

@@ -1,5 +1,5 @@
FROM node:12.13.1
WORKDIR /home/web
WORKDIR /home/src/electricitymap/contrib/web
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in order to keep consistent with brick paths

// Note: `resolvePath` is executed on the client as well,
// as it is used in react components. We can't therefore include any variables
// in its closure. It would be better to pass a `pathPrefix` instead.
resolvePath: (!isProduction || isStaging)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the important non-lint change to make sure we use GCS in production

@@ -224,7 +222,13 @@ app.use('/', (req, res) => {
}
});

if (isProduction) {
app.get('/*', (req, res) =>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legacy redirect (but shouldn't be necessary)

@corradio corradio requested a review from FelixDQ December 26, 2020 11:35
Copy link
Member

@FelixDQ FelixDQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 💪

@corradio corradio mentioned this pull request Jan 3, 2021
6 tasks
@corradio corradio enabled auto-merge (squash) January 4, 2021 08:00
@corradio corradio merged commit 7357ef0 into master Jan 4, 2021
@corradio corradio deleted the olc/emap-static-to-gcs branch January 4, 2021 08:13
con-cat pushed a commit to con-cat/electricitymap-contrib that referenced this pull request May 18, 2021
* Deploy electricityMap static assets to GCS

* update dockerfile paths

* Revert

* Fix dockerfile

* Add config

* update container path

* No need to clean dir

* rename env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants